﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GMaps
{
    public class GMap:GElement 
    {        
        public string DIV { get; set; }
        public int Zoom { get; set; }
        public GLatLng  Center { get; set; }

        public string Render()
        {
            string script = RenderMap();
            return script; 
        }

        private string RenderMap()
        {
            //hacer mas configurable
            string script = "var " + ID + "Options = {      zoom: " + Zoom + ",      center: new " + Center.Render() + ",      mapTypeId: google.maps.MapTypeId.ROADMAP    };";

            script += " "+ID+"=CreateMap('" + DIV + "', " + ID + "Options);";
            return script;
        }
    }
}
